function test
    clc
    close all
%    a = 1;
%    r = 2.5*a: a/1000: 10*a;
%    y1 = func1(r, a);
%    y2 = func2(r, a);
%    y3 = -y1 +y2;
%    figure
%    hold on
%    plot(r, y1, '-r');
%    plot(r, y2, '-.b');
%    plot(r, y3, '-g');
%    
%    hold off
   
   x = gallery('uniformdata',[20,1],0)
   y = gallery('uniformdata',[20,1],1)
   k = convhull(x, y)
   k = k(1: end-1)
   z = complex(x(k), y(k))
   BetterMedial(z')

end


function y = func1(r, a)
    y = 4 ./ (r+a).^2 + 4 ./ (r-a).^2;
end

function y = func2(r, a)
    y1 = 6 ./ r.^2;
    y2 = 1 ./ (r-2*a).^2;
    y3 = 1 ./ (r+2*a).^2;
    y = y1 +y2 +y3;

end
